package com.cn.ss.main;

import com.cn.ss.processor.IntegerClientProcessor;
import com.cn.ss.protocol.IntegerProtocol;
import org.smartboot.socket.transport.AioQuickClient;

/**
 * Created by chenyuncong on 2019/3/26.
 */
public class IntegerClient {
    public static void main(String[] args) throws Exception {
        IntegerClientProcessor processor = new IntegerClientProcessor();
        AioQuickClient<Integer> aioQuickClient = new AioQuickClient<Integer>("localhost", 8888, new IntegerProtocol(), processor);
        aioQuickClient.start();
        long startTime=System.currentTimeMillis();
        for(int i=0;i<10000;i++){
            processor.getSession().write(i);
        }
        System.out.println(System.currentTimeMillis()-startTime);

            Thread.sleep(1000);
        aioQuickClient.shutdown();
    }
}
